package cn.wolfcode.rbac.query;

import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Setter
@Getter
public class CustomerChartQueryObject extends  QueryObject {
    private String keyword;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;
    private String groupType="e.name";
    public String getGroupTypeName(){
        String groupTypeName=null;
        if(groupType.equals("e.name")){
            groupTypeName="员工";
        }else if(groupType.equals("DATE_FORMAT(c.input_time, '%Y')")){
            groupTypeName="年";
        }else if(groupType.equals("DATE_FORMAT(c.input_time, '%Y-%m')")){
            groupTypeName="月";
        }else if(groupType.equals("DATE_FORMAT(c.input_time, '%Y-%m-%d')")){
            groupTypeName="日";
        }
        return groupTypeName;
    }
}
